package top.szhome.develop.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.szhome.develop.convert.PropertyConverter;
import top.szhome.develop.dto.PropertiesSettingDTO;
import top.szhome.develop.dto.PropertyDTO;
import top.szhome.develop.entity.Property;
import top.szhome.develop.qry.PropertyQry;
import top.szhome.develop.service.PropertyService;
import top.szhome.develop.vo.PropertyVO;
import top.szhome.framework.core.tools.support.Resp;
import top.szhome.framework.starter.db.support.SimpleController;

/**
 * 属性接口实现
 *
 * @author 唐加利
 * @date 2023/08/21
 **/
@AllArgsConstructor
@RestController
@RequestMapping("/develop/property")
@Tag(name = "属性 接口")
public class PropertyController extends SimpleController<PropertyService, PropertyConverter, PropertyQry, PropertyDTO, Property, PropertyVO> {

    /**
     * 属性设置
     *
     * @param settings
     * @return
     */
    @Operation(summary = "属性设置", description = "配置代码生成时属性字段的状态和行为")
    @PostMapping("setting")
    public Resp setting(@RequestBody @Validated PropertiesSettingDTO settings){
        getBaseService().setting(settings);
        return Resp.success();
    }

}
